package com.qfedu.edu.stockservice.controller;


import com.qfedu.edu.result.R;
import com.qfedu.edu.stockservice.service.StockStorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xiaobobo
 * @since 2024-11-06
 */
@RestController
@RequestMapping("/stockservice/stock-storage")
public class StockStorageController {

    @Autowired
    private StockStorageService stockStorageService;

    /**
     * 添加库存
     * @param classId
     * @param count
     * @return
     */
    @PostMapping("/addStock")
    public R addStock(String classId,Integer count){
        int realCount=stockStorageService.addStock(classId,count);
        return R.ok().data("realCount",realCount);
    }

}

